package com.fly.demo.entity;

import java.io.Serializable;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.Range;

/**
 * 
 * user表对应的User实体
 * 
 * @author 00fly
 * @version [版本号, 2018-09-11]
 * @see [相关类/方法]
 * @since [产品/模块版本]
 */
public class User implements Serializable
{
    
    private static final long serialVersionUID = -1708801992568176110L;
    
    // id
    private Long id;
    
    // age
    @NotNull(message = "年龄不能为空")
    @Min(value = 9, message = "年龄不能小于9")
    @Max(value = 61, message = "年龄不能大于61")
    @Range(min = 10, max = 60, message = "年龄必须在{min}-{max}")
    private Integer age;
    
    // name
    @NotBlank(message = "用户名不能为空")
    private String name;
    
    public Long getId()
    {
        return id;
    }
    
    public void setId(Long id)
    {
        this.id = id;
    }
    
    public void setAge(Integer age)
    {
        this.age = age;
    }
    
    public Integer getAge()
    {
        return this.age;
    }
    
    public void setName(String name)
    {
        this.name = name;
    }
    
    public String getName()
    {
        return this.name;
    }
}
